package com.vhall.component.controller.pendant;

import com.vhall.component.controller.pendant.facade.PendantConsoleFacade;
import com.vhall.component.entity.page.vo.PageVO;
import com.vhall.component.entity.pendant.vo.*;
import com.vhall.component.framework.common.annotation.VhallComponent;
import com.vhall.component.plugin.common.annotation.TokenAuth;
import com.vhall.component.plugin.common.enums.OperateTypeEnum;
import com.vhall.component.service.annotation.OperateLog;
import com.vhall.component.service.pendant.PendantConsoleService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * console端接口
 *
 * @author guoxin.wang
 * @date 2021-10-29 11:25
 */
@VhallComponent
public class PendantConsoleController implements PendantConsoleFacade {

    @Autowired
    private PendantConsoleService pendantConsoleService;

    @TokenAuth
    @Override
    @OperateLog(module = "挂件管理-主持人端", type = OperateTypeEnum.CREATE, name = "创建")
    public Boolean create(PendantCreateOrUpdateReqVO reqVO) {
        return pendantConsoleService.create(reqVO);
    }

    @TokenAuth
    @Override
    @OperateLog(module = "挂件管理-主持人端", type = OperateTypeEnum.DELETE, name = "删除")
    public Boolean delete(PendantDeleteReqVO reqVO) {
        return pendantConsoleService.delete(reqVO);
    }

    @TokenAuth
    @Override
    @OperateLog(module = "挂件管理-主持人端", type = OperateTypeEnum.UPDATE, name = "修改")
    public Boolean edit(PendantCreateOrUpdateReqVO reqVO) {
        return pendantConsoleService.edit(reqVO);
    }


    @TokenAuth
    @Override
    public PageVO<PendantRspVO> list(PendantListReqVO reqVO) {
        return pendantConsoleService.list(reqVO);
    }

    @TokenAuth
    @Override
    @OperateLog(module = "挂件管理-主持人端", type = OperateTypeEnum.UPDATE, name = "设置默认固定挂件")
    public Boolean setDefaultFixed(PendantSetDefaultReqVO reqVO) {
        return pendantConsoleService.setDefaultFixed(reqVO);
    }

//    @TokenAuth
    @Override
    public PageVO<PendantListStatsRspVO> listStats(PendantListStatsReqVO reqVO) {
        return pendantConsoleService.listStats(reqVO);
    }

    @Override
    @TokenAuth
    @OperateLog(module = "挂件管理-主持人端", type = OperateTypeEnum.UPDATE, name = "绑定或解绑")
    public Boolean bindingOperation(BindingOperationReqVO reqVO) {
        return pendantConsoleService.bindingOperation(reqVO);
    }
    @TokenAuth
    @Override
    public List<PendantRspVO> bindingList(PendantListReqVO reqVO) {
        return pendantConsoleService.bindingList(reqVO);
    }

    @Override
    @TokenAuth
    public PageVO<PendantRspVO> unbindingList(PendantListReqVO reqVO) {
        return pendantConsoleService.unbindingList(reqVO);
    }

}


